package com.springBoot.springBootSysCore.modules.vo;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>树形菜单节点信息VO</p>
 * @author timo
 */
public class TreeNodeVo implements Serializable{
	private static final long serialVersionUID = -5986168628239921292L;
	private String id;	//节点主键ID
	private String name;//节点名称
	private String text;//节点名称

	private String code;//权限

	private Integer isButton;//判断是否是按钮

	private boolean checked;//是否选中
	private String chkDisabled;//是否禁用选中
	private String iconSkin;//节点图标 css
	private String iconClose;//节点关闭class
	private String iconOpen;//节点展开class
	private String iconCls;//节点图标--easyui
	private String open;//是否打开
	private String expanded;//是否展开
	private String alias;//菜单对应的页面别名
	private String controller;//控制器
	private String url;//链接
	private String isClass;//---在线学习项目中是否是班级
	private boolean leaf;//是否是链接菜单
	private boolean isParent;//是否为父节点 true  || false
	private boolean nocheck;//true 表示此节点不显示 checkbox / radio，不影响勾选的关联关系，不影响父节点的半选状态。
	private String remark;//备注

	private boolean spread=false;
	/** 以下两种父子关系 任选一种 **/
	private String pId;//父节点Id  使用这种方式(setting.data.simpleData.enable=true)时生效
	private List<TreeNodeVo> children = new ArrayList<TreeNodeVo>();//子节点集合


	public Integer getIsButton() {
		return isButton;
	}

	public void setIsButton(Integer isButton) {
		this.isButton = isButton;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getUrl() {
		return url;
	}


	public void setUrl(String url) {
		this.url = url;
	}


	public String getExpanded() {
		return expanded;
	}


	public void setExpanded(String expanded) {
		this.expanded = expanded;
	}

	public TreeNodeVo() {
		super();
	}
	
	
	public boolean getLeaf() {
		return leaf;
	}

	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}

	public String getAlias() {
		return alias;
	}


	public void setAlias(String alias) {
		this.alias = alias;
	}


	public String getController() {
		return controller;
	}


	public void setController(String controller) {
		this.controller = controller;
	}


	public String getChkDisabled() {
		return chkDisabled;
		
	}

	public void setChkDisabled(String chkDisabled) {
		this.chkDisabled = chkDisabled;
	}

	public boolean getChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	public String getIconSkin() {
		return iconSkin;
	}


	public void setIconSkin(String iconSkin) {
		this.iconSkin = iconSkin;
	}


	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<TreeNodeVo> getChildren() {
		return children;
	}
	public String getName() {
		return name;
	}
	public void setChildren(List<TreeNodeVo> children) {
		this.children = children;
	}
	public String getOpen() {
		return open;
	}
	public void setOpen(String open) {
		this.open = open;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public boolean getIsParent() {
		return isParent;
	}
	public void setIsParent(boolean isParent) {
		this.isParent = isParent;
	}
	public String getIconCls() {
		return iconCls;
	}
	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
	public void setParent(boolean isParent) {
		this.isParent = isParent;
	}
	public boolean isNocheck() {
		return nocheck;
	}
	public void setNocheck(boolean nocheck) {
		this.nocheck = nocheck;
	}
	public String getIconClose() {
		return iconClose;
	}
	public void setIconClose(String iconClose) {
		this.iconClose = iconClose;
	}
	public String getIconOpen() {
		return iconOpen;
	}
	public void setIconOpen(String iconOpen) {
		this.iconOpen = iconOpen;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getpId() {
		return pId;
	}
	public void setpId(String pId) {
		this.pId = pId;
	}


	/**
	 * 将查询的树的父级去掉勾选框
	 * @param tree
	 * @return
	 */
	public static List<TreeNodeVo> getNocheckTree(List<TreeNodeVo> tree){
		if(tree!=null){
			for (TreeNodeVo treeNodeVo : tree) {
				if(treeNodeVo.getChildren()!=null&&treeNodeVo.getChildren().size()>0){
					treeNodeVo.setNocheck(true);
					treeNodeVo.setChildren(getNocheckTree(treeNodeVo.getChildren()));
				}
			}
		}
		return tree;
	}


	public boolean isSpread() {
		return spread;
	}

	public void setSpread(boolean spread) {
		this.spread = spread;
	}

	public String getIsClass() {
		return isClass;
	}


	public void setIsClass(String isClass) {
		this.isClass = isClass;
	}

}
